def sum(k):
    if k == 1:
        return 1
    return k + sum(k - 1)

def total(m, n):
   
    total_n = sum(n)
    total_m = sum(m - 1)
    return total_n - total_m
m, n = 2, 4

ans = total(m, n)
print(ans)